<!--{template common/header_simple_start}-->
<link href="{MOD_PATH}/images/folder.css?{VERHASH}" rel="stylesheet" media="all">
<link href="{MOD_PATH}/images/comment.css?Xqd" rel="stylesheet" media="all">
<link href="static/dzzthumb/jquery.dzzthumb.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/dzzthumb/jquery.dzzthumb.js?{VERHASH}"></script>
<link rel="stylesheet" type="text/css" href="static/lyear/js/bootstrap-lyear-select/bootstrap-lyear-select.css?{VERHASH}">
<style type="text/css">
	.overflow-auto{
		max-height: 180px;
	}
	.lie{
		min-width: 120px
	}
</style>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<div class="bs-container clearfix">
	<div class="bs-left-container clearfix">
		<!--{template left}-->
	</div>
	<div class="left-drager">
    <div class="left-drager-op">
      <div class="left-drager-sub"></div>
    </div>
  </div>
  <div class="bs-main-container">
		<!--{if !$list}-->
		<div style="text-align: center;">
			<img src="static/image/common/no_list.png" /><br>
			<span class="no-result-title">{lang no_relevant_content}</span>
		  </div>
		<!--{else}-->
		<div class="main-header clearfix">
			<form name="search" class="form-horizontal" action="{MOD_URL}" method="get">
        <input type="hidden" name="mod" value="{MOD_NAME}" />
        <ul class="nav nav-pills">
          <li class="pull-left btn-secetlt" style="display: none;">
            <button  class="btn btn-danger " type="submit" value="{lang delete}" onclick="delete_file();">{lang delete}</button>
          </li>
					<li class="pull-left btn-secetlt" style="display: none;">
            <button  class="btn btn-primary col sharepame-selected" disabled>已选择<span class="ex-number"></span>项</button>
          </li>
        </ul>
      </form>
    </div>
      <form id="appform" name="appform" class="form-horizontal " action="{MOD_URL}" method="post" >
				<input type="hidden" name="lpp" value="$lpp">
        <input type="hidden" name="formhash" value="{FORMHASH}" />
				<input type="hidden" name="keyword" value="$keyword" /> 
				<div class="table-responsive-xxl">
				<table class="table table-hover">
          <thead node-type="title" class="title">
            <tr class="item clearfix">
              <th node-type="title-col"  class="col">
								<div class="col-sm-10">
                  <div class="form-check">
                    <input class="form-check-input" name="del[]" type="checkbox" id="chkall"><label></label>
                  </div>
                </div>
              </th>
              <th class="lie">内容</th>
              <th class="lie">IP地址</th>
              <th class="lie">设备信息</th>
              <th node-type="title-col" data-key="dateline" class="lie col">发布时间<span class="asc $_GET[dateline]" style="visibility: <!--{if $_GET[dateline]}-->visible<!--{else}-->hidden<!--{/if}-->;"></span> </th>
              <!--{if $_G['adminid']}--><th node-type="title-col" data-key="author" class="lie col">发布人<span class="asc $_GET[author]" style="visibility: <!--{if $_GET[author]}-->visible<!--{else}-->hidden<!--{/if}-->;"></span></th><!--{/if}-->
			  <th class="lie">操作</th>
            </tr>
          </thead>
          <tbody node-type="list" class="list list-share">
						<!--{loop $list $value}-->
            <tr node-type="item" id="comment_$value[cid]" data-cid="$value[cid]" class="item shareblock clearfix">
              <td data-name="$value[name]" class="col">
								<div class="col-sm-10">
                  <div class="form-check">
                    <input type="checkbox" class="form-check-input"  name="del[]" value="$value[cid]" data-cid="$value[cid]">
                    <label></label>
                  </div>
                </div>
              </td>
              <td node-type="name" class="name" title="$value[name]" data-size="$value[name]"><div class="overflow-auto">$value[message]</div></td>
              <td><div>$value[ip]</div></td>
              <td><div>$value[xtllq]</div></td>
              <td><div>{eval echo dgmdate($value[dateline])}</div></td>
              <!--{if $_G['adminid']}--><td><div>$value[author]</div></td><!--{/if}-->
              <td>
                <div>
                  <a class="btn btn-outline-info" href="javascript:void(0);" title="{lang delete}" onclick="feed_delete('$value[cid]','comment_$value[cid]','$value[cid]')"><i class="dzz dzz-delete"></i></a>
									<!--{if $_G['adminid']}--><a class="btn btn-outline-info" title="编辑" hidefocus="true" href="javascript:void(0);" onclick="feed_edit('$value[cid]','$_GET[allowattach]','$_GET[allowat]','$_GET[allowsmiley]');"><i class="dzz dzz-create"></i></a><!--{/if}-->
                </div>
              </td>
            </tr>
            <!--{/loop}--> 
          </tbody>
        </table>
        </div>
				<div class="pull-left">
          <div class="input-group mb-3">
            <span class="input-group-text">每页显示</span>
            <select class="form-select" onchange="if(this.options[this.selectedIndex].value != '') {this.form.lpp.value = this.options[this.selectedIndex].value;this.form.submit(); }">
              <option value="10" $checklpp[10]> 10 </option>
              <option value="20" $checklpp[20]> 20 </option>
              <option value="40" $checklpp[40]> 40 </option>
              <option value="100" $checklpp[100]> 100 </option>
              <option value="200" $checklpp[200]> 200 </option>
            </select>
            <span class="input-group-text">条记录</span>
          </div>
        </div>
      </form>
    $multi
	<!--{/if}-->
  </div>
</div>
<script type="text/javascript">
function feed_edit(cid,allowattach,allowat,allowsmiley){
	showWindow('publish_edit_'+cid,DZZSCRIPT+'?mod=comment&op=ajax&do=edit&cid='+cid+'&allowattach='+allowattach+'&allowat='+allowat+'&allowsmiley='+allowsmiley);
}
function feed_delete(cid,domid,tid){
	var msg='';
	if(tid){
		msg=__lang.sure_want_delete_comment;
	}else{
		msg=__lang.sure_want_delete_all_comment;
	}
	if(confirm(msg)){
		jQuery.getJSON(DZZSCRIPT+'?mod=comment&op=ajax&do=delete&cid='+cid,function(json){
			jQuery('#'+domid).slideUp(500,function(){
				jQuery(this).remove();
				if(tid ){
					 var replysum=parseInt(jQuery('#comment_reply_'+tid+'.item').html());
					 if(replysum>0) jQuery('#comment_reply_'+tid+'.item').html(replysum-1);
				}
			});
			try{
				callback_by_comment(domid,'delete');
			}catch(e){}
		});
	}
}
var cids=[];
var theurl='$theurl';
	jQuery(document).ready(function(e) {
		 jQuery('select').lyearSelect({
      width:70,
    });
		jQuery(document).on('mouseenter', 'div[node-type=item]', function() {
			jQuery(this).addClass('item-hover');
		});
		jQuery(document).on('mouseleave', 'div[node-type=item]', function() {
			jQuery(this).removeClass('item-hover');
		});
		jQuery('.title .item .col[node-type=title-col][data-key=dateline],.title .item .col[node-type=title-col][data-key=author]').on('click', function() {
			var el = jQuery(this);
			el.find('.asc').css('visibility', 'visible').toggleClass('desc');
			el.siblings().find('.asc').css('visibility', 'hidden');
			
			var param=el.data('key')+'='+ (el.find('.asc').hasClass('desc') ? 'desc' : 'asc');
			var regx=new RegExp('&(dateline|author)=(asc|desc)','i');
			var url=theurl.replace(regx,'')+'&'+param;
			location.href=correcturl(url);
		});
	});
//复选框选中问题
jQuery(document).off('click.shareclick').on('click.shareclick',".shareblock",function(){
	var checkinput = jQuery(this).find("input[name='del[]']");
	if(checkinput.prop('checked')){
		checkinput.prop('checked',false);
		jQuery(this).removeClass('item-block');
		
		var cid=jQuery(this).find('input[name="del[]"]').data('cid');
		var index = jQuery.inArray(cid,cids);
		if(index != -1){
			cids.splice(index,1);
		}

	}else{
		checkinput.prop('checked',true);
		jQuery(this).addClass('item-block');
		var cid=jQuery(this).data('cid');
			if(jQuery.inArray(cid,cids) == -1){
				cids.push(cid);
			}

	}
	sharelength();
});
jQuery(document).off('click.inputclick').on('click.inputclick',".shareblock input[name='del[]']",function(){
	if($(this).prop('checked')){
		jQuery(this).prop('checked',false);
		jQuery(this).removeClass('item-block');
		
	}else{
		jQuery(this).prop('checked',true);
		jQuery(this).addClass('item-block');
	}
});
//复选框全选
jQuery(document).off('click.allclick').on('click.allclick','#chkall',function(){
	var allchecked=jQuery(this).prop('checked');
	jQuery(this).closest('.title').next('.list-share').find('input[name="del[]"]').each(function(){
		if(allchecked){
			jQuery(this).prop('checked',true);
			jQuery(this).closest('.item').addClass('item-block');
			var cid=jQuery(this).data('cid');
			if(jQuery.inArray(cid,cids) == -1){
				cids.push(cid);
			}
		}else{
			jQuery(this).prop('checked',false);
			jQuery(this).closest('.item').removeClass('item-block');
			var cid=jQuery(this).data('cid');
			var index = jQuery.inArray(cid,cids);
			if(index != -1){
				cids.splice(index,1);
			}

		}
	});
	sharelength();
})
function sharelength(){
  if(cids.length>0){
    jQuery('.sharepame-selected').show().next('.show_first').hide();
    jQuery('#chkall').prop('checked',true);
    jQuery('.btn-secetlt').show();
  }else{
    jQuery('.sharepame-selected').hide().next('.show_first').show();
    jQuery('#chkall').prop('checked',false);
    jQuery('.btn-secetlt').hide();
  }
  jQuery('.ex-number').html(cids.length);
}
function delete_file(){
	var delnums = cids.length;
	var icoids = cids.join(',');
	if(confirm('你确定要删除'+delnums+'条评论吗(如果有回复评论也将一同删除)？')){
		jQuery.post('{MOD_URL}&do=delete',{'cid':icoids},function(data){
			if(data['success']){
				window.location.reload();
			}else{

			}
		})
	}
}
</script>
<script type="text/javascript" src="static/lyear/js/bootstrap-lyear-select/bootstrap-lyear-select.js?{VERHASH}"></script>
<!--{template common/footer_simple}-->